var t = require("../common/index.js");

require("../../../utils/image.js");
var app = getApp()
Component({
  properties: {
    data: {
      type: Object
    },
    floorIndex: {
      type: Number
    }
  },
  data: { imgurl: app.getImgUrl() },
  methods: {
    goLink: function (e) {
      var o = e.currentTarget.dataset, a = o.type, i = o.positionIndex, n = o.timestamp, r = e.currentTarget.offsetTop;
      console.log(e.currentTarget);
      var s = this.data.floorIndex;
      if ("goods" === a) {
        var p = e.currentTarget.dataset.item, d = p.id, m = p.activityId;
        if (!d) return;
        (0, t.goLink)({
          type: "goods",
          data: { item: p },
          saOption: {
            componentName: "slbum",
            floorIndex: s,
            positionIndex: i,
            timestamp: n,
            offsetTop: r
          }
        });
      } else if ("page" === a) {
        var f = e.currentTarget.dataset.link;
        (0, t.goLink)({
          type: "page",
          data: {
            item: p
          },
          saOption: {
            componentName: "slbum",
            floorIndex: s,
            positionIndex: i,
            timestamp: n,
            offsetTop: r
          }
        });
      } else if ("multitype" === a) {
        var u = e.currentTarget.dataset.item, l = u.type, c = u.data;
        if (!l) return;
        (0, t.goLink)({
          type: "multitype",
          data: {
            type: l,
            item: u
          },
          saOption: {
            componentName: "slbum",
            floorIndex: s,
            positionIndex: i,
            timestamp: n,
            offsetTop: r
          }
        });
      }
    }
  }
});